<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>myProject</title>
    <!-- 引入 lib/echarts.custom.min.js -->
    <script src="echarts.js"></script>
</head>
<body>
    <div id="main" style="width: 600px;height:400px;border:3px solid red"></div>
    <script>
        // 绘制图表。
        echarts.init(document.getElementById('main')).setOption({
            title: {text: '标签人数分布',  left: 'center'},
            //tooltip: {trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)'},
            legend: {orient: 'vertical', left: 'left', data: ['流失用户', '回流用户', '连续活跃用户', '新用户', '活跃用户']},
    series: [
        {
            name: '访问来源',
            type: 'pie',
            radius: '55%',
            center: ['50%', '60%'],
            data: [
                {value: 183472, name: '流失用户'},
                {value: 6546, name: '回流用户'},
                {value: 524, name: '连续活跃用户'},
                {value: 91, name: '新用户'},
                {value: 0, name: '活跃用户'}
            ],
        },
        // {
        //     name: '访问来源',
        //     type: 'bar',
        //     data: [
        //         {value: 183472, name: '流失用户'},
        //         {value: 6546, name: '回流用户'},
        //         {value: 524, name: '连续活跃用户'},
        //         {value: 91, name: '新用户'},
        //         {value: 0, name: '活跃用户'}],
        // }
    ]

        });
    </script>
</body>
</html>


